<div class="container" ng-if="state =='loading'">
    <div class="page-header">
        <h1>数据加载中......ヾ(ｏ･ω･)ﾉ</h1>
    </div>
</div>
<div class="container" ng-if="state == 'error'">
    <div class="page-header">
        <h1>加载失败啦ミﾟДﾟ彡,刷新下页面试试</h1>
    </div>
</div>
<div class="container" ng-if="state == 'finished'">
    <!-- 页头 -->
    <div class="page-header">
        <h1>管理申请</h1>
    </div>
    <!-- 信息栏 -->
    <div class="row">
        <div class="col-xs-8">
            <div class="btn-group">
                <button class="btn btn-info">团队数</button>
                <button class="btn btn-info">{{allTeamNumber}}</button>
            </div>
            <div class="btn-group">
                <button class="btn btn-warning">未审核</button>
                <button class="btn btn-warning">{{nonAuditNumber}}</button>
            </div>
            <div class="btn-group">
                <button class="btn btn-success">已同意</button>
                <button class="btn btn-success">{{agreeNumber}}</button>
            </div>
            <div class="btn-group">
                <button class="btn btn-danger">已拒绝</button>
                <button class="btn btn-danger">{{rejectNumber}}</button>
            </div>
        </div>
        <div class="col-xs-4 text-right">
            <div class="btn-group" uib-dropdown>
                <button id="split-button" type="button" class="btn btn-default">{{currentCate}}</button>
                <button type="button" class="btn btn-default" uib-dropdown-toggle>
                    <span class="caret"></span>
                    <span class="sr-only">Split button!</span>
                </button>
                <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="split-button">
                    <li role="menuitem"><a href="" ng-click="switchFilter('全部')">全部</a></li>
                    <li class="divider"></li>
                    <li role="menuitem"><a href="" ng-click="switchFilter('未审核')">未审核</a></li>
                    <li role="menuitem"><a href="" ng-click="switchFilter('已同意')">已同意</a></li>
                    <li role="menuitem"><a href="" ng-click="switchFilter('已拒绝')">已拒绝</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="row">
        <table class="table table-striped">
            <thead>
            <tr>
                <td>申请日期</td>
                <td>团队名</td>
                <td>负责人</td>
                <td>负责人电话</td>
                <td>审核状态</td>
                <td>详情</td>
            </tr>
            </thead>
            <tbody>
            <!--<tr>-->
            <!--<td>2017-08-01</td>-->
            <!--<td>TPW</td>-->
            <!--<td>黄一鑫</td>-->
            <!--<td>15392035361</td>-->
            <!--<td ng-class="{'text-primary':true}">未审核</td>-->
            <!--<td><a href="">详情</a></td>-->
            <!--</tr>-->
            <tr ng-repeat="team in teamInPage">
                <td>{{team.submitDate}}</td>
                <td>{{team.teamName}}</td>
                <td>{{team.members[0].studentName}}</td>
                <td>{{team.members[0].phoneNumber}}</td>
                <td ng-class="{'text-warning':team.auditOpinion == '未审核',
                'text-danger':team.auditOpinion == '已拒绝',
                'text-success':team.auditOpinion == '已同意'}">
                    {{team.auditOpinion}}
                </td>
                <td><a href="" ng-click="checkDetails(team)">详情</a></td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="row text-center">
        <ul uib-pagination max-size="pagination.maxPageSize" ng-model="pagination.currentPage"
            total-items="pagination.totalItems"
            items-per-page="pagination.itemsPerPage" previous-text="上一页" next-text="下一页"
            boundary-links="false" ng-change="pageChange()" direction-links="true" boundary-link-numbers="true"
            force-ellipses="true"></ul>
    </div>
</div>

<!-- 团队申请详细信息对话框 -->
<script type="text/ng-template" id="manage-register-dialog.html">
    <div class="modal-header">
        <button type="button" class="close" ng-click="dismiss()"><span aria-hidden="true">&times;</span></button>
        <h3 class="modal-title">申请详情</h3>
    </div>
    <div class="modal-body">
        <div class="form-horizontal">
            <div class="form-group">
                <label class="control-label col-xs-2 text-primary">团队名称:</label>
                <div class="well well-sm col-xs-4 dialog-form-field">{{team.teamName}}</div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2 text-primary">所属领域:</label>
                <div class="well well-sm col-xs-4 dialog-form-field">{{team.belongField}}</div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2 text-primary">项目名称:</label>
                <div class="well well-sm col-xs-4 dialog-form-field">{{team.projectName}}</div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2 text-primary">项目类型:</label>
                <div class="well well-sm col-xs-4 dialog-form-field">{{team.projectType}}</div>
            </div>
            <div class="form-group">
                <div class="col-xs-10 col-xs-offset-1">
                    <h4 class="text-center text-primary">团队成员</h4>
                    <table class="table table-striped">
                        <thead>
                        <tr class="warning">
                            <td>姓名</td>
                            <td>学院</td>
                            <td>学号</td>
                            <td>学历</td>
                            <td>联系电话</td>
                            <td>邮箱</td>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="member in team.members" ng-class="{'info':member.orderInTeam == 1}">
                            <td>{{member.studentName}}</td>
                            <td>{{member.college}}</td>
                            <td>{{member.studentId}}</td>
                            <td>{{member.educationBackground}}</td>
                            <td>{{member.phoneNumber}}</td>
                            <td>{{member.email}}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2 text-primary">项目简介:</label>
                <div class="well well-sm col-xs-8 dialog-form-field"><pre>{{team.projectBrief}}</pre></div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2 text-primary">主营业务:</label>
                <div class="well well-sm col-xs-8 dialog-form-field"><pre>{{team.projectDirector}}</pre></div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2 text-primary">前期基础:</label>
                <div class="well well-sm col-xs-8 dialog-form-field"><pre>{{team.workFoundation}}</pre></div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2 text-primary">项目规划:</label>
                <div class="well well-sm col-xs-8 dialog-form-field"><pre>{{team.plan}}</pre></div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2 text-primary">上传文件:</label>
                <div class="col-xs-8">
                    <div class="row">
                        <ul class="list-unstyled">
                            <li ng-repeat="file in team.files">
                                <a href="{{requestRootUrl + 'api/manage-register/download-file/' + team.teamId + '/' + file + '/'}}">{{file}}</a>
                            </li>
                        </ul>
                    </div>
                    <div class="row">
                        <a type="button" class="btn btn-info"
                           href="{{requestRootUrl + 'api/manage-register/download-zip/' + team.teamId + '/'}}">打包下载</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" ng-show="team.auditOpinion == '未审核'" ng-click="agree()">同意申请
        </button>
        <button type="button" class="btn btn-default" ng-show="team.auditOpinion == '未审核'" ng-click="refuse()">退回申请
        </button>
        <button type="button" class="btn btn-success disabled" ng-show="team.auditOpinion == '已同意'">您已经同意该申请</button>
        <button type="button" class="btn btn-danger disabled" ng-show="team.auditOpinion == '已拒绝'">您已经退回该申请</button>
    </div>
</script>
